/**
 * Yolema.com Inc.
 * Copyright (c) 2011-2012 All Rights Reserved.
 */
package org.grayrabbit.pay.core.biz.manager.system.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.grayrabbit.pay.core.model.results.PayResult;
import org.grayrabbit.pay.core.model.results.GenericsResult;
import org.grayrabbit.pay.core.model.pages.PageList;
import org.grayrabbit.pay.core.biz.manager.system.SystemConfigManager;
import org.grayrabbit.pay.core.model.entity.system.SystemConfig;
import org.grayrabbit.pay.core.service.system.SystemConfigService;

/**
 * 
 * 
 * @author liyd
 * @version $Id: SystemConfigManagerImpl.java, v 0.1 Fri Jun 01 11:14:01 CST
 *          2012 liyd Exp $
 */
@Component
public class SystemConfigManagerImpl implements SystemConfigManager {

    @Autowired
    private SystemConfigService systemConfigService;

    /**
     * 查询业务列表
     * 
     * @param district
     * @return
     */
    public GenericsResult<PageList<SystemConfig>> queryPageList(SystemConfig systemConfig) {

        GenericsResult<PageList<SystemConfig>> result = new GenericsResult<PageList<SystemConfig>>(
            true);

        result.setResultData(systemConfigService.queryPageList(systemConfig));

        return result;
    }

    /**
     * 根据Id得到实体对象
     * 
     * @param id
     * @return
     */
    public GenericsResult<SystemConfig> getById(Long id) {

        GenericsResult<SystemConfig> result = new GenericsResult<SystemConfig>(true);

        result.setResultData(systemConfigService.getById(id));

        return result;

    }

    /**
     * 根据id批量删除
     * 
     * @param idArray
     * @return
     */
    public PayResult deleteBatchById(Long[] idArray) {

        PayResult result = new PayResult(true);

        systemConfigService.deleteBatchById(idArray);

        return result;
    }

    /**
     * 添加一个对象
     * 
     * @param systemConfig
     * @return
     */
    public GenericsResult<SystemConfig> insert(SystemConfig systemConfig) {

        GenericsResult<SystemConfig> result = new GenericsResult<SystemConfig>(true);

        systemConfigService.insert(systemConfig);

        return result;

    }

    /**
     * 更新一个对象
     * 
     * @param systemConfig
     * @return
     */
    public GenericsResult<Integer> update(SystemConfig systemConfig) {

        GenericsResult<Integer> result = new GenericsResult<Integer>(true);

        result.setResultData(systemConfigService.update(systemConfig));

        return result;
    }

    /**
     * 删除一个对象
     * 
     * @param systemConfig
     * @return
     */
    public PayResult delete(SystemConfig systemConfig) {

        PayResult result = new PayResult(true);

        systemConfigService.delete(systemConfig);

        return result;
    }

}
